using System;

namespace CSW.Framework.Common.Binding.Events
{
    /// <summary>
    /// Provides data for the ReadOnlyChanged event.
    /// </summary>
    public sealed class ReadOnlyChangedEventArgs : EventArgs
    {
        private readonly string m_PropertyName;
        private readonly bool m_IsReadOnly;

        /// <summary>
        /// Initializes a new instance of the <see cref="InvalidDataEventArgs"/> class.
        /// </summary>
        /// <param name="propertyName">Name of the property.</param>
        /// <param name="isReadOnly">if set to <c>true</c>, indicates the property is read only.</param>
        public ReadOnlyChangedEventArgs(string propertyName, bool isReadOnly)
        {
            m_PropertyName = propertyName;
            m_IsReadOnly = isReadOnly;
        }

        /// <summary>
        /// Gets the property name.
        /// </summary>
        /// <value>The property name.</value>
        public string PropertyName
        {
            get { return m_PropertyName; }
        }

        /// <summary>
        /// Gets a value indicating whether the property is read only.
        /// </summary>
        /// <value><c>true</c> if the property is read only; otherwise, <c>false</c>.</value>
        public bool IsReadOnly
        {
            get { return m_IsReadOnly; }
        }
    }
}